package com.insta.playdroid.metier.domain;

import java.io.File;
import java.io.Serializable;

import android.net.Uri;

public class Song implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3372011288966255602L;
	private String title;
	private String artist;
	private String album;
	private int year;
	private float time;
	private String location;
	private String songComposer;
	private String songNumberInAlbum;
	private String songGenre;
	private String songWriter;
	private Uri image; // TODO avirer
	private int id;

	public Song(int id, String titre, String path, String artist,
			String album, String albumArt) {
		super();
		this.id = id;
		this.title = titre;
		this.artist = artist;
		Uri uri = pathToUri(albumArt);
		if (uri != null)
			this.image = uri;
		this.album = album;
		this.location = path;
	}

	public int getId() {
		return id;
	}

	public Song() {
		super();
	}

	public String getSongComposer() {
		return songComposer;
	}

	public void setSongComposer(String songComposer) {
		this.songComposer = songComposer;
	}

	public String getSongNumberInAlbum() {
		return songNumberInAlbum;
	}

	public void setSongNumberInAlbum(String songNumberInAlbum) {
		this.songNumberInAlbum = songNumberInAlbum;
	}

	public String getSongGenre() {
		return songGenre;
	}

	public void setSongGenre(String songGenre) {
		this.songGenre = songGenre;
	}

	public String getSongWriter() {
		return songWriter;
	}

	public void setSongWriter(String songWriter) {
		this.songWriter = songWriter;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getArtist() {
		return artist;
	}

	public void setArtist(String artist) {
		this.artist = artist;
	}

	public String getAlbum() {
		return album;
	}

	public void setAlbum(String album) {
		this.album = album;
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public float getTime() {
		return time;
	}

	public void setTime(float time) {
		this.time = time;
	}

	public Uri getImage() {
		return image;
	}

	public void setImage(Uri uri) {
		this.image = uri;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Uri pathToUri(String path) {

		Uri uri = null;
		if (path != null) {
			uri = Uri.fromFile(new File(path));
		}

		return uri;
	}

}
